<SCRIPT type="text/javascript">
	function submitSearchForm(action){
		$("#beginNum").val($("#beginNumShow").val());
		$("#endNum").val($("#endNumShow").val());
		$("#action").val(action);
		$("#searchForm").submit();
	}
	function listSubmitForm(id){
		$("#beginNumShow").val(1);
		$("#endNumShow").val(20);
		$("#searchForm").attr("action","/${orgi}/manage/task/"+id+"/taskruninglist.html");
		submitSearchForm('current');
	}
</SCRIPT>
<!--<div class="rs_layout_right" style="width:300px;"></div>-->
<div class="rs_layout_center" style="width:750px;background: #fff;">
	<div class="rs_layout">
		<div class="rs_layout_top" style="height:<#if report?? && task.taskstatus == '2'><#if task?? && task.catalog??>173<#else>145</#if><#else><#if task?? && task.catalog??>145<#else>117</#if></#if>px; overflow:hidden; border-bottom: solid 1px #d7d7d7;">
			<div class="rs_layout">
				<div class="rs_layout_center">
					<div class="rs_layout">
					
						<div class="rs_layout_top" >
							
							<div class="artMain">
								<div class="mainCenter" style="margin-left: 10px; margin-right: 20px">
									<table class="data_table_1" >
										<tr>
											<th>任务名称：</th>
											<td>
											${task.name!''}
											</td>
											<th>任务类型：</th>
											<td>
												<#if task.tasktype?? && task.tasktype == "table">数据结算</#if>
												<#if task.tasktype?? && task.tasktype == "report">报表服务</#if>
											</td>
										</tr>
										
										<tr>
											<th>开始时间：</th>
											<td>
												<#if task.starttime??>${task.starttime?string("yyyy年MM月dd HH:mm:ss")}</#if>
											</td>
											<th><#if task.endtime??>结束时间：</#if></th>
											<td>
												<#if task.endtime??>${task.endtime?string("yyyy年MM月dd HH:mm:ss")}</#if>
											</td>
										</tr>
										
										
										<tr>
											<th>状态：</th>
											<td>
											<#if task.resulttype??>
												<#if task.resulttype==1>成功<#elseif task.resulttype==2>失败&nbsp;<img alt="" src="/assets/images/msg_error_8.gif"><#elseif task.resulttype==3>已取消<#else>原因不明</#if>	 												
											<#else>
												<#if task.taskstatus == "1">
												等待执行
												<#elseif  task.taskstatus == "2">
												执行中
												<#else>
												计划执行
												</#if>
											</#if>
											</td>
											<th>执行人：</th>
											<td>${task.username!''}
											</td>
										</tr>
									    <#if report?? && task.taskstatus == "2">
										<tr>
											<th>执行状态：</th>
											<td colspan="3">
												已处理：${report.pages} , 错误：${report.errors} ，完整性验证失败：${report.filter}	，处理速度：${report.speed} 条/秒，线程数：${report.threads}
											</td>
										</tr>
										</#if>
										<#if task?? && task.catalog??>
										<tr>
											<th>执行结果：</th>
											<td colspan="3" style="color:#0000cc;">
												<div style="height:25px;overflow-y:auto;"><#noescape>${task.catalog}</#noescape>	</div>
											</td>
										</tr>
										</#if>
									</table>
								</div>
							</div>
						</div>
						
					</div>
				</div>
			</div>
		</div>
		<div class="rs_layout_center" style="height: 260px;">
			
			<div class="tableScrollWrap">
				<form class="form-horizontal" id="searchForm" data-toggle="ajax-noclose-form" data-target=".d-content" name="form" action="/${orgi}/manage/task/${task.id}/taskruninglist.html" method="post">
					<input type="hidden" id="beginNum" name="beginNum" value="1">
					<input type="hidden" id="endNum" name="endNum" value="10">
					<input type="hidden" id="action" name="action" value="current">
					<div class="task_title2">
						<span style="float: left;">执行历史</span>
						<span style="font-size: 12px;float:right;">状态：
						<select onchange="submitSearchForm('current')" name="status" style="height:23px;padding-top:1px;">
							<option <#if status=='0'>selected="selected"</#if> value="0">所有状态</option>
							<option <#if status=='1'>selected="selected"</#if> value="1">成功</option>
							<option <#if status=='2'>selected="selected"</#if> value="2">失败</option>
							<option <#if status=='3'>selected="selected"</#if> value="3">取消</option>
						</select>
						</span>
					</div>
				</form>	
				<table class="table_style_1">
					<thead>
						<tr>
							<th style="width:20px;">&nbsp;</th>
							<th><i class="verMidWrap">名称（目录）</i><i class="tbArrow"></i></th>
							<th><i class="minSize">执行时间</i><i class="tbArrow"></i></th>
							<th><i class="minSize">执行人</i><i class="tbArrow"></i></th>
							<th class="minSize">状态</th>
						</tr>
					</thead>
					<tbody>
						
						<#if historytasks??>
						<#list historytasks as task>
						<tr>
							<td>&nbsp;</td>
							<td><a href="javascript:listSubmitForm('${task.id!''}')"><i class="icons_tablelist_task"></i>${task.name!''}</a></td>
							<td class="minSize">${task.starttime?string("yyyy年MM月dd HH:mm:ss")}</td>
							<td class="minSize">${task.username!''}(${task.nickname!''})</td>
							<td class="minSize">
								<#if task.resulttype==1>成功<#elseif task.resulttype==2>失败&nbsp;&nbsp;<img alt="" src="/assets/images/msg_error_8.gif"> <#elseif task.resulttype==3>已取消<#else>原因不明</#if>
							</td>
						</tr> 
						</#list>
						</#if>
					</tbody>
				</table>
			</div>

		</div>
		<div class="rs_layout_bottom">
			<#include "../../public/pagination.html"/>
		</div>

	</div>
</div>
